#!/usr/bin/python
# -*- coding: utf-8 -*-

"""
#TODO: documentation!
"""


__version__ = '$Id: __init__.py 191 2008-02-14 05:43:52Z DLacewell $'


version = '0.1'

from bipy import engine

#---- functions ----#
_initialzed = False

def init(log_file_name=None, config=None):
    # TODO: read config

    global _initialzed
    _initialzed = True


def get_init():
    global _initialzed
    return _initialzed

class NotInitializedError(Exception):
    pass

def raise_init():
    global _initialzed
    if _initialzed:
        return _initialzed
    raise NotInitializedError('bipy has not been initialized yet, run bipy.init(...)')


def run(scene):
    eng = engine.EngineClass()
    eng.run(scene(eng))
